import request from './index'

// 获取活动列表（包含用户报名状态）
export function getEventsWithRegistration() {
  return request({
    url: '/events/with-registration',
    method: 'get',
  })
}

// 获取活动列表
export function getEvents() {
  return request({
    url: '/events',
    method: 'get',
  })
}

// 创建活动
export function createEvent(data) {
  return request({
    url: '/events',
    method: 'post',
    data,
  })
}

// 报名活动
export function registerEvent(eventId) {
  return request({
    url: '/events/register',
    method: 'post',
    data: { eventId },
  })
}

// 删除活动
export function deleteEvent(eventId) {
  return request({
    url: `/events/${eventId}`,
    method: 'delete',
  })
}
